#include "stdafx.h"
#include "AircraftType.h"
#include "LongTermStand.h"
#include "Time.h"
#include "Aircraft.h"

#ifndef EMPTY
#define EMPTY 0
#define OCCUPIED 1
#endif

/*------------------------------------------------------------
/ Long Term Stand Class
/ By: Mark Freedman
/ Date: February 26 2011
/ Description: A definition of the Long Term Stand Class. Defines the
/ extended attribute current aircraft as well as defining a getter and
/ setter method
------------------------------------------------------------*/

/*------------------------------------------------------------
/ Constructor
/ By: Mark Freedman
/ Date: February 26 2011
/ Description: Instantiates any long term stand object
/ Paramneters: stand ID, deallocation time
/ Return: N/A
------------------------------------------------------------*/
LongTermStand::LongTermStand(std::string stID){
	standID = stID;
	standStatus = EMPTY;
	typeList = new std::list<AircraftType> ();
	currentAircraft = new Aircraft ();
}

/*------------------------------------------------------------
/ Constructor
/ By: Mark Freedman
/ Date: February 26 2011
/ Description: Instantiates any long term stand object
/ Paramneters: stand ID, deallocation time
/ Return: N/A
------------------------------------------------------------*/
LongTermStand::LongTermStand(std::string stID, std::list<AircraftType> *type){
	standID = stID;
	standStatus = EMPTY;
	typeList = type;
	currentAircraft = new Aircraft ();
}

/*------------------------------------------------------------
/ Destructor
/ By: Mark Freedman
/ Date: February 26 2011
/ Description: destroys a long term stand object
/ Paramneters: N/A
/ Return: N/A
------------------------------------------------------------*/
LongTermStand::~LongTermStand(void)
{
}

/*------------------------------------------------------------
/ getCurrentAircraft
/ By: Mark Freedman
/ Date: February 26 2011
/ Description: returns the current aircraft occupant
/ Paramneters: N/A
/ Return: the aircraft 
------------------------------------------------------------*/
Aircraft* LongTermStand::getCurrentAircraft (void){
	return currentAircraft;
}

/*------------------------------------------------------------
/ setCurrentAircraft
/ By: Mark Freedman
/ Date: February 26 2011
/ Description: sets the curent aircraft at the stand
/ Paramneters: the aircraft
/ Return: N/A
------------------------------------------------------------*/
<<<<<<< .mine
void LongTermStand::setCurrentAircraft (Aircraft *plane){
	if (currentAircraft->getAircraftID() == -1){
		currentAircraft->~Aircraft();
		currentAircraft = plane;
	}else{
		printf ("ERROR IN LONGTERMSTAND.CPP! REPLACING EXISTING AIRCRAFT AT STAND BEFORE IT HAS LEFT\n");
	}
}

/*------------------------------------------------------------
/ setCurrentAircraft
/ By: Mark Freedman
/ Date: February 26 2011
/ Description: sets the curent aircraft at the stand
/ Paramneters: the aircraft
/ Return: N/A
------------------------------------------------------------*/
void LongTermStand::setCurrentAircraft (){
	currentAircraft = new Aircraft ();
}



/*------------------------------------------------------------
/ getTypeList
/ By: Trevor
/ Date: February 29 2011
/ Description: 
/ Parameters: none
/ Return: pointer to a list of aircraft types accomodated by this stand
------------------------------------------------------------*/	
std::list<AircraftType>* LongTermStand::getTypeList(){
	return typeList;

}

/*------------------------------------------------------------
/ setTypeList			
/ By: Trevor
/ Date: February 29 2011
/ Description:
/ Parameters: gets the stand to take a new  set of aircraft types accomodateable by the stand 
/ Return: none
------------------------------------------------------------*/	
void LongTermStand::setTypeList(std::list<AircraftType>* _typeList){
	typeList = _typeList;
}

/*------------------------------------------------------------
/ 
/ By: Trevor
/ Date: February 29 2011
/ Description: adds a new type of aircraft accomodateable by the stand 
/ Parameters:	a pointer to a list of aircraftTypes
/ Return: none
------------------------------------------------------------*/	
void LongTermStand::addAircraftType(AircraftType* _type){
	typeList->push_back(*_type);
}
=======
void LongTermStand::setCurrentAircraft (Aircraft *plane){
	if (currentAircraft->getAircraftID() == -1){
		currentAircraft->~Aircraft();
		currentAircraft = plane;
	}else{
		printf ("ERROR IN LONGTERMSTAND.CPP! REPLACING EXISTING AIRCRAFT AT STAND BEFORE IT HAS LEFT\n");
	}
}

/*------------------------------------------------------------
/ setCurrentAircraft
/ By: Mark Freedman
/ Date: February 26 2011
/ Description: sets the curent aircraft at the stand
/ Paramneters: the aircraft
/ Return: N/A
------------------------------------------------------------*/
void LongTermStand::setCurrentAircraft (){
	currentAircraft = new Aircraft ();
}
>>>>>>> .r38
